package com.hspedu.properties;

import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/3/1
 * @time 16:13
 */
public class Properties05 {
    public static void main(String[] args) {
        Properties properties = new Properties();
        try {
            properties.load(new FileInputStream("D:\\workspace_idea\\java0\\hspedu\\chapter19\\src\\dog.properties"));
            properties.setProperty("color","black");
            properties.store(new FileWriter("D:\\workspace_idea\\java0\\hspedu\\chapter19\\src\\dog.properties"),null);
            properties.list(System.out);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
